package com.cpecc.manager.wuzi;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cpecc.dao.wuzi.TuiHuoDao;
import com.cpecc.model.system.User;
import com.cpecc.model.wuzi.TuiHuo;

@Service
@Transactional
public class TuiHuoManager {

	@Autowired
	private TuiHuoDao tuiHuoDao;
	
	public void save(TuiHuo tuiHuo){
		tuiHuoDao.save(tuiHuo);
	}
	
	public TuiHuo get(String id){
		return tuiHuoDao.get(id);
	}
	
	public boolean cover(TuiHuo tuiHuo){
		return tuiHuoDao.cover(tuiHuo);
	}
	
	public List<TuiHuo> getAllTuiHuoSQ(int huanJie){
		return tuiHuoDao.getAllTuiHuoSQ(huanJie);
	}
	
	public List<TuiHuo> getAllTuiHuoSQ2CMR(int huanJie, User user){
		return tuiHuoDao.getAllTuiHuoSQ2CMR(huanJie,user);
	}
	
	public boolean hasWuZi(String wuZiId){
		return tuiHuoDao.hasWuZi(wuZiId);
	}
	
	public boolean hasLiuCheng(User user){
		return tuiHuoDao.hasLiuCheng(user);
	}
	
	public List<TuiHuo> activeTuiHuo(){
		return tuiHuoDao.activeTuiHuo();
	}
}
